package com.lcm.springcloud.common;

import lombok.Data;

import java.io.Serializable;

/**
 * 统一JSON返回类型
 *
 * @author: Coder-Lcm
 * @date: 2020/10/26 16:48
 */
@Data
public class ResultBean<T> implements Serializable {

    private Integer code;
    private String msg;
    private T data;

    public ResultBean(){
        super();
    }

    public ResultBean(Integer code, String msg){
        super();
        this.msg = msg;
        this.code = code;
    }

    public ResultBean(Throwable e, Integer code){
        super();
        this.code = code;
        this.msg = e.getMessage();
    }
}
